<?php
require("config/config.php");
require("common.php");
$mysql = new SaeMysql();
 
$uid= strip_tags( $_REQUEST['uid'] );
$min= strip_tags( $_REQUEST['min'] );
 
if(is_numeric($uid) && is_numeric($min)){
	if($min == 0){
		$sql = "SELECT * FROM `bottle` WHERE uid = " .$uid ." ORDER BY bid DESC LIMIT ".GET_MAX_COUNT;
	}else{
		$sql = "SELECT * FROM `bottle` WHERE uid = " .$uid . " AND bid < ". $min . " ORDER BY bid DESC LIMIT ".GET_MAX_COUNT;
	}
	
	$result= $mysql->getData( $sql );
	if( $mysql->errno() != 0 )
	{
		echo "false";
	}else{
		echo myjson($result);
	}
}else{
	echo "false";
}
$mysql->closeDb();
?>
